package com.medical.view.admin.login;

import org.apache.wicket.model.PropertyModel;

 
import com.medical.model.admin.Account;
import com.medical.view.menu.MainPage;
import com.medical.view.wicket.Model.MedCompoundModel;
import com.medical.view.wicket.form.MedButton;
import com.medical.view.wicket.form.MedForm;
import com.medical.view.wicket.form.MedPasswordTextField;
import com.medical.view.wicket.form.MedTextField;
import com.medical.view.wicket.html.MedWebPage;
import com.medical.view.wicket.html.panal.MedPanel;

public class Login extends MedWebPage {

	public Login() {
		
//		MedPanel panel =new MedPanel("div");
		LoginForm form = new LoginForm("form");
		add(form);

	}

}

class LoginForm extends MedForm {

	Account account = new Account();

	public LoginForm(String id) {
		super(id);
		setModel(new MedCompoundModel(account));
		MedTextField accountTxt = new MedTextField("accountName");
		MedPasswordTextField passTxt = new MedPasswordTextField("password"  );
		
		add(accountTxt);
		add(passTxt);
		
		MedButton submitBut = new MedButton("submit") {
			@Override
			public void onSubmit() {
				// account.setId(1l);
				super.onSubmit();
				setResponsePage(MainPage.class);
			}

		};

		add(submitBut);
	}

}
